<template>
  <div class="infinite-container">
    <div class="bg-cjwt">
      <mu-list class="message">
        <mu-list-item
          :title="item.questionTitle"
          class="bgwhite"
          @click="clickHanle(item)"
          v-for="item in newsdata"
          :key="item.id"
        >
          <i class="iconfont icon-small-arrow-right" slot="right" />
        </mu-list-item>
        <mu-divider></mu-divider>
      </mu-list>
    </div>
  </div>
</template>
<script>
// import { newsdata } from "./newsdata.js";
import { commonAjaxJson, RESTFUL_API } from "../../api/api";
export default {
  data() {
    return {
      newsdata: []
    };
  },
  mounted() {
    this.getQuestionList();
  },
  methods: {
    clickHanle(item) {
      sessionStorage.newscontent = item.questionAnswer;
      this.$router.push(`/medicalRecord/faq/${item.id}?title=${item.questionTitle}`);
    },

    getQuestionList() {
      
      let params = {
        questionTitle: "",
        keyword: "",
        questionType: "4",
        pageNum: 1,
        pageSize: 100
      };

      commonAjaxJson(RESTFUL_API.getQuestionList, params, true).then(res => {
        
        const {code, data} = res.data
        if (code == 200) {
          this.newsdata = data.list;
        } else{
          this.newsdata = []
        }
      });
    }
  }
};
</script>
<style scoped>
.bg-cjwt {
  padding: 190px 1em 1em;
  background-image: url(../../assets/img_blfy_cjwt@2x.png);
  background-repeat: no-repeat;
  background-size: contain;
  height: 100vh;
}
.message {
  border-radius: 8px;
}
</style>

